We have findLastIndex() nowadays to search an array in reverse
direction.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3967>
(cherry picked from commit
8e29babca8adc677fcd5bc8457f497dd849ae884)
}
_findPreviousPoint(pos) {
- const reversedIndex = this._snapPoints.slice().reverse().findIndex(p => p <= pos);
- return this._snapPoints.length - 1 - reversedIndex;
+ return this._snapPoints.findLastIndex(p => p <= pos);
}
_findPointForProjection(pos, velocity) {